package com.qitianyong.selfclass;

import android.content.Context;
import android.support.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.bumptech.glide.GlideBuilder;
import com.bumptech.glide.Registry;
import com.bumptech.glide.annotation.GlideModule;
import com.bumptech.glide.load.engine.executor.GlideExecutor;
import com.bumptech.glide.module.AppGlideModule;
import com.gkusbsdk.SZUSBFile;

import java.nio.ByteBuffer;

/**
 * Created by gy on 2018/3/22.
 */
@GlideModule
public class MyAppGlideModule extends AppGlideModule {
    @Override
    public void registerComponents(Context context, Glide glide, Registry registry) {
        registry.prepend(SZUSBFile.class, ByteBuffer.class, new UvcModelLoader.UvcModelLoaderFactory());

    }

    @Override
    public void applyOptions(@NonNull Context context, @NonNull GlideBuilder builder) {
        super.applyOptions(context, builder);
        builder.setSourceExecutor(GlideExecutor.newSourceExecutor(1,"single",null));
    }
}
